********************************************************************************
** Purpose: Replication Code for Tables in Paper
** Project: Missionary Activity, Education, and Long-run Political Development  
** Written by: Soeren J. Henn  
** Last updated: 2025-05-29
********************************************************************************

version 13.1 
clear all
set more off 
set maxvar 32200

**!!!!!! add location of Replication Archive here
else if c(username) == "soerenhenn" {
	global dir "~/Dropbox/Missionaries/Replication Archive"
}
else {
	display as error "Please specify root directory"
	exit 
}  

global data "$dir/data"
global code "$dir/code"
global output "$dir/output"
	
********************************************************************************
*********************************** Load data **********************************
********************************************************************************
use "$data/analysis_data.dta", clear	
	
drop if T_Closer10==.
	
cd "$output"
	

********************************************************************************
************************* Table 1: Balance regressions *************************
********************************************************************************
** Panel A: Climate and Geography
reghdfe temperature Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_temp
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe rainfall Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_rain
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe Log_elevation Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_elev
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe ruggedness Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_rugg
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe index_malaria Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_malaria_index
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe index_tsetse Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_tsetse_index
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
** Panel B: Location
reghdfe Log_dist_explroutes Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_explore
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe Log_dist_rail Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_rail
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe Log_dist_waterway Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_waterway
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe Log_dist_coast Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique) 
	est sto b_coast
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
	
reghdfe Log_dist_capital Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_capital
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
	
reghdfe Log_dist_natborder Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_natborder
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
	
** Panel C: Natural Resources and Individual COntrols		
reghdfe diamonds_within50 Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique) 
	est sto b_diamonds
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe oil_within50 Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_oil
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe gas_within50 Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_gas
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
	
reghdfe cashcrop Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_cc
	estadd local FE_border "YES"
	estadd local FE_country "NO"		estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe female Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_female
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe age Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto b_age
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
	
esttab b_rain b_temp b_elev b_rugg b_malaria_index b_tsetse_index using table1_a.tex, ///
	replace se r2 label title(Balance \label{table_1_a}) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons)
esttab b_explore b_rail b_waterway b_coast b_capital b_natborder using table1_b.tex, ///
	replace se r2 label title(Balance \label{table_1_b}) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons)
esttab b_diamonds b_oil b_gas b_cc b_female b_age using table1_c.tex, ///
	replace se r2 label title(Balance \label{table_1_c}) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons)
		

********************************************************************************
******** Table 2: Missionary presence, religious identity and schooling ********
********************************************************************************
** Panel A: Missionary Presence and Religious Identity
	
reghdfe  Catholic50kms_Same Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10  if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto fs_10
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  Catholic50kms_Different Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10  if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto fs_p_10
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm

reghdfe catholic_m Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto r_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm

** Panel B: Education
reghdfe schooling_ordinal Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls'  if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto e_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe primary_inc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls'  if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto e_2
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe secondary_inc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls'  if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto e_4
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
esttab fs_10 fs_p_10 r_1 using table_2_a.tex, replace se r2 label title(First Stage \label{firststage}) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	mtitles("Catholic Mission within 50km" "Catholic Mission in Neighbouring" "Catholic today") ///
	drop(_cons `controls')

esttab e_1 e_2 e_4 using table_2_b.tex, replace se r2 label title(First Stage \label{firststage}) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	mtitles("Schooling Ordinal" "Any Primary" "Any Secondary") ///
	drop(_cons `controls')

		
********************************************************************************		
********* Table 3: The effect on political participation by regime type ********
********************************************************************************
********** Panel A: Index of Political Participation

foreach var in voted_dum contact_loc attend_comm raised_issue{
	egen z_`var' = std(`var')
}
alpha z_voted_dum z_contact_loc z_attend_comm z_raised_issue, gen(index_participation) std

	
local controls "age female"
	
reghdfe  index_participation Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto pp_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_participation Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto pp_1_dem
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_participation Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto pp_1_open
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_participation Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto pp_1_closed
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
esttab pp_1 pp_1_dem pp_1_open pp_1_closed using table_3_a.tex, replace se r2 label title(Effect on Index of Political Particiaption made up of Voting, Contact Local Councillor, Attending Community and Raised Issue) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons `controls') ///
	mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 
		
********** Panel B: Index Voting and Contacted
alpha z_voted_dum z_contact_loc, gen(index_vote_contact) std


local controls "age female"
	
reghdfe  index_vote_contact Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto pp_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_vote_contact Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto pp_1_dem
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_vote_contact Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto pp_1_open
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_vote_contact Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto pp_1_closed
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
esttab pp_1 pp_1_dem pp_1_open pp_1_closed using table_3_b.tex, replace se r2 label title(Effect on Index of Voting and Contact Local Councillor) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons `controls') ///
	mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 		
		

********** Panel C: Index of Community Participation

alpha z_raised_issue z_attend_comm, gen(index_community1) std	

local controls "age female"
	
reghdfe index_community1 Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe index_community1 Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_dem
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe index_community1 Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_open
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe index_community1 Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_closed
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
esttab v_1 v_1_dem v_1_open v_1_closed using table_3_c.tex, replace se r2 label title(Effect on Index Community made up of Attendance and Raised Issue) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons `controls') ///
	mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 

*******************************************************************************************
** Table 4: The effect on socio-political status and interest in politics by regime type **
*******************************************************************************************
********** Panel A: Index on Socio-Political Status and Interest in Politics
foreach var in radio_news discuss_politics employed_dum{
	egen z_`var' = std(`var')
}

alpha z_employed_dum z_radio_news z_discuss_politics, gen(index_sophistication) std

local controls "age female"
	
reghdfe  index_sophistication Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto ps_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_sophistication Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto ps_1_dem
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_sophistication Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto ps_1_open
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_sophistication Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto ps_1_closed
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
esttab ps_1 ps_1_dem ps_1_open ps_1_closed using table_4_a.tex, replace se r2 label title(Effect on Index of Political Sophistication made up of News Ordinal, Discuss Politics, and Employed) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons `controls') ///
	mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 

	
	
********** Panel B: Employed
local controls "age female"
	
reghdfe employed_dum Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe employed_dum Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_dem
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe employed_dum Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_open
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe employed_dum Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_closed
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
esttab v_1 v_1_dem v_1_open v_1_closed using table_4_b.tex, replace se r2 label title(Effect on Employment) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons `controls') ///
	mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 	
		

	
********** Panel C: Radio News Consumption and Discuss Politics
alpha z_radio_news z_discuss_politics, gen(index_radio_discuss) std

local controls "age female"
	
reghdfe index_radio_discuss Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe index_radio_discuss Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_dem
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe index_radio_discuss Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_open
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe index_radio_discuss Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_closed
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
esttab v_1 v_1_dem v_1_open v_1_closed using table_4_c.tex, replace se r2 label title(Effect on Radio News Consumption and Discuss Politics) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons `controls') ///
	mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 	
		

********************************************************************************
** Table 5: The effect on civil values and political attitudes by regime type **		
********************************************************************************

********** Panel A:	Index of Support for Democratic Institutions	

alpha op_reject_oneparty op_reject_oneman op_pres_obey op_pres_disc, gen(support_inst) std
		
local controls "age female"
	
reghdfe support_inst Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe support_inst Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_dem
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe support_inst Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_open
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe support_inst Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_closed
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
esttab v_1 v_1_dem v_1_open v_1_closed using table_5_a.tex, replace se r2 label title(Effect on Index of Democratic views made up of Satisfied with Democracy,  Effect on Support for Democracy and Democratic Institutions ) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons `controls') ///
	mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 


		
********** Panel B: Satisfied with democracy	
local controls "age female"
	
reghdfe sat_dem Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe sat_dem Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_dem
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe sat_dem Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_open
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe sat_dem Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto v_1_closed
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
				
		
esttab v_1 v_1_dem v_1_open v_1_closed  using table_5_b.tex, replace se r2 label title(Effect on Satisfied with democracy) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons `controls') ///
	mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 		
		
********** Panel C: Incumbent Performance and Support
	
foreach var in over_perf_inc close_inc_party close_opp_party{
	egen z_`var' = std(`var')
}
alpha z_close_opp_party z_close_inc_party, gen(index_inc) std
alpha z_over_perf_inc index_inc, gen(index_perfinc) std
	
local controls "age female"
	
reghdfe  index_perfinc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
	est sto ps_1
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_perfinc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto ps_1_dem
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_perfinc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto ps_1_open
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
reghdfe  index_perfinc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
	est sto ps_1_closed
	estadd local FE_border "YES"
	estadd local FE_country "NO"
	estadd local FE_round "YES"
	estadd local Cluster "BORDER"
	estadd ysumm
		
esttab ps_1 ps_1_dem ps_1_open ps_1_closed using table_5_c.tex, replace se r2 label title(Effect on Index made up of Index of Performance and Corruption, and Index of Incumbent Support) ///
	scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
	"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	drop(_cons `controls') ///
	mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 
		
		
		
		

	
	
	
